/**
 * @author yanggjun
 */

KeyEventListener = {
	keyboard: "",	
	add: function(){
		this.keyboard = new THREEx.KeyboardState();	
	},
	handleKeyEvent: function(){
		if(this.keyboard.pressed("w")){
			PlayMan.move("f");
		}else if(this.keyboard.pressed("s")){
			PlayMan.move("b");
		}else if(this.keyboard.pressed("a")){
			PlayMan.move("l");
		}else if(this.keyboard.pressed("d")){
			PlayMan.move("r");
		}else if(this.keyboard.pressed("q")){
			CameraController.rotateCameraByKey("l");
			Character.updatePosition();
		}else if(this.keyboard.pressed("e")){
			CameraController.rotateCameraByKey("r");
			Character.updatePosition();
		}else if(this.keyboard.pressed("space")){
			PlayMan.jump();
		}else if(this.keyboard.pressed("1")){
			console.log("pressed 1");
			ShootController.weaponType = 0;
			Character.updatePosition();
		}else if(this.keyboard.pressed("2")){
			ShootController.weaponType = 1;
			Character.updatePosition();
		}
	},
}